<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        li {
            list-style: none;
        }

        .wrap {
            padding: 8px;
        }

        .list {
            margin-top: 10px;
        }

        .list li {
            height: 40px;
            line-height: 40px;
            text-indent: 10px;
            border: 1px dashed #333;
        }

        .list li+li {
            border-top: 0;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <h2 id="title">jquery元素获取</h2>
        <div class="list">
            <li class="first">01</li>
            <li>02</li>
            <li class="mid">03</li>
            <li>04</li>
            <li>05</li>
            <li class="last">06</li>
        </div>
    </div>
</body>
<script>


    // jquery对象 获取 原生DOM元素   
    // 1. 对应下标取值
    // console.log($(".list li")[2]);
    // console.log($(".list li").get(2));


    // 2. jquery对象转真数组
    // var list = Array.prototype.slice.call($(".list li"));
    // console.log(list, Array.isArray(list));

    // var list = Array.from($(".list li"));
    // console.log(list, Array.isArray(list));

    // var list = [...$(".list li")];
    // console.log(list, Array.isArray(list));


    // get(index)  有参数 => 返回对应下标的元素(原生DOM元素)
    // get()       没有参数 => 返回jquery对象对应的真数组
    console.log($(".list li").get(2));

    var list = $(".list li").get()
    console.log(list, Array.isArray(list));

</script>

</html>